* Extra results from appendix C. 
use data_others.dta, clear

global true_mayor_controls mayor_male mayor_married mayor_age mayor_education mayor_prev_mayor mayor_share_vote_margin mayor_dum_PT
global muni_controls lpib_pc gini illiteracy share_urb radio_am 
	label var lpib_pc "GDP per capita (in ln)"
	label var radio_am "AM Radio Station"
	label var gini "Gini index"
	label var illiteracy "Illiteracy rate"
	label var share_urb	"Share urban population"
		
global candidate_controls male married age education prev_mayor dum_PT
	label var prev_mayor "Previous mayor"
	label var dum_PT "Workers' Party dummy"
		 
 
*table c.14

* Bolsa Familia
	global BEFORE before
	global corrupt broad
	
	local Other_reg "bolsa_pc valor"
		
	foreach dep_var of varlist `Other_reg' {
	    
	* Median  + controls    
			eststo m_c_`dep_var': quietly areg `dep_var' $BEFORE above_median_corrupt median_before $muni_controls $true_mayor_controls i.term if eligible == 0, absorb(codigo_uf) robust  cluster(id_city)
				sum `dep_var' if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": m_c_`dep_var'
				estadd local mayor_municipal "\checkmark": m_c_`dep_var'
				* Add Test interactions
				lincom $BEFORE + median_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': m_c_`dep_var'
				estadd local p_value `p_test': m_c_`dep_var'


	*Quartile  + controls
			eststo q_c_`dep_var': quietly areg `dep_var' $BEFORE quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before $muni_controls $true_mayor_controls i.term if eligible == 0, absorb(codigo_uf) robust  cluster(id_city)
				sum `dep_var' if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": q_c_`dep_var'
				estadd local mayor_municipal "\checkmark": q_c_`dep_var'
				* Add Test interactions
				lincom $BEFORE + quart4_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': q_c_`dep_var'
				estadd local p_value `p_test': q_c_`dep_var'								
	}
	
		
* Regressions Public Employment
preserve
capture gen Before_1 = before_1
	replace Before_1 = 1 if Before_1 == 0 &  lottery == 25 & term ==2005
	label var Before_1 "Lottery occurred before the year previous of the election."

	replace before = Before_1
	
	global BEFORE before
	global corrupt broad
	
	local Other_reg "empl_perm_pc empl_trans_pc"
		
	foreach dep_var of varlist `Other_reg' {
	    
	* Median  + controls
	    
			eststo m_c_`dep_var': quietly areg `dep_var' $BEFORE above_median_corrupt median_before $muni_controls $true_mayor_controls i.term if eligible == 0, absorb(codigo_uf) robust  cluster(id_city)
				sum `dep_var' if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": m_c_`dep_var'
				estadd local mayor_municipal "\checkmark": m_c_`dep_var'
				* Add Test interactions
				lincom $BEFORE + median_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': m_c_`dep_var'
				estadd local p_value `p_test': m_c_`dep_var'


	*Quartile  + controls
	
			eststo q_c_`dep_var': quietly areg `dep_var' $BEFORE quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before $muni_controls $true_mayor_controls i.term if eligible == 0, absorb(codigo_uf) robust  cluster(id_city)
				sum `dep_var' if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": q_c_`dep_var'
				estadd local mayor_municipal "\checkmark": q_c_`dep_var'
				* Add Test interactions
				lincom $BEFORE + quart4_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': q_c_`dep_var'
				estadd local p_value `p_test': q_c_`dep_var'								
	}
	
restore
	
  eststo dir
	  
		#delimit;
		esttab 
			m_c_bolsa_pc q_c_bolsa_pc m_c_valor q_c_valor 
			m_c_empl_perm_pc q_c_empl_perm_pc m_c_empl_trans_pc q_c_empl_trans_pc
			using "tables and figures\table_c14.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace
			mtitles( "Median" "Quartile"  "Median" "Quartile" "Median" "Quartile" "Median" "Quartile") 
			mgroups( "\shortstack{Beneficiary families \\(\% population)}"   "Value of benefits" "Permanent employees" "Transitory employees"  , pattern(1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) 
			keep($BEFORE above_median_corrupt median_before 
				 quart2_before quart3_before quart4_before quartile2 quartile3 quartile4)
			stats(N mD r2_a b0_b2 p_value, fmt(%9.0fc %9.3fc ) labels("Observations" "Dep. Var. Mean" "Adjusted R$^2$" "$\beta_0+\beta_2 \, c_{ist}$" "p-value"))
			/*nonum*/ ar2 booktabs nonotes /*nomtitles*/ title(deletethis) 
			substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{table} %);
			#delimit cr



	
* Table c.15 
* Effect of reputation shocks On coalition members' campaign expenditure (per capita)
eststo clear	

	* 0. Baseline: Average causal Impact of Information Disclosure.
		eststo reg_broad_basic: quietly areg camp_exp_pc before i.term , absorb(codigo_uf) robust cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_broad_basic

		* 0.1. baseline + controls
		eststo reg_broad_basic_c: quietly areg camp_exp_pc before $muni_controls $candidate_controls i.term , absorb(codigo_uf) robust cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_broad_basic_c
				estadd local mayor_municipal "\checkmark": reg_broad_basic_c
	
	* 1. Broad				
		eststo reg_broad: quietly areg camp_exp_pc before broad before_broad i.term , absorb(codigo_uf) robust cluster($cluster)
				* Add mean dependent variable
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_broad
				lincom before + before_broad
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_broad
				estadd local p_value `p_test': reg_broad

		*1.2. broad + controls			
		eststo reg_broad_c: quietly areg camp_exp_pc before broad before_broad  $muni_controls $candidate_controls i.term , absorb(codigo_uf) robust cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_broad_c
				estadd local mayor_municipal "\checkmark": reg_broad_c
				lincom before + before_broad
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_broad_c
				estadd local p_value `p_test': reg_broad_c				

	* 2. fraction_broad		
		eststo reg_fraction: quietly areg camp_exp_pc before fraction_broad corrupt_before i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_fraction
				sum fraction_broad if e(sample), mean 
				loc my_mean: display %9.3f r(mean)				
				lincom before + corrupt_before * `my_mean'	
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_fraction
				estadd local p_value `p_test': reg_fraction		
				
		*2.2 fraction_broad + controls			
		eststo reg_fraction_c: quietly areg camp_exp_pc before fraction_broad corrupt_before $muni_controls $candidate_controls  i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_fraction_c
				estadd local mayor_municipal "\checkmark": reg_fraction_c
				sum fraction_broad if e(sample), mean 
				loc my_mean: display %9.3f r(mean)				
				lincom before + corrupt_before * `my_mean'	
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_fraction_c
				estadd local p_value `p_test': reg_fraction_c
								
	* 3. above_median_broad 							
		eststo reg_median: quietly areg camp_exp_pc before above_median_corrupt median_before i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_median
				lincom before + median_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_median
				estadd local p_value `p_test': reg_median

		*3.2. above_median_broad + controls
		eststo reg_median_c: quietly areg camp_exp_pc before above_median_corrupt median_before $muni_controls $candidate_controls i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_median_c
				estadd local mayor_municipal "\checkmark": reg_median_c
				lincom before + median_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_median_c
				estadd local p_value `p_test': reg_median_c

	* 4. quartiles broad
		eststo reg_quart:   quietly areg camp_exp_pc before quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before i.term, absorb(codigo_uf) robust cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_quart
				lincom before + quart4_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_quart
				estadd local p_value `p_test': reg_quart

		*4.2 quartiles broad + controls
		eststo reg_quart_c: quietly areg camp_exp_pc before quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before $muni_controls $candidate_controls   i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_quart_c
				estadd local mayor_municipal "\checkmark": reg_quart_c
				lincom before + quart4_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_quart_c
				estadd local p_value `p_test': reg_quart_c
						

						
* EXPORT TABLE TO LATEX		
		#delimit;
			esttab reg_broad_basic reg_broad_basic_c reg_broad reg_broad_c reg_fraction reg_fraction_c reg_median reg_median_c reg_quart reg_quart_c
			using "tables and figures\table_c15.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace
			mgroups( "\shortstack{Information \\ disclosure}" "Corruption"   "Share corruption"  "\shortstack{Median \\ Corruption}"   "\shortstack{Quartiles\\ Corruption}"  , pattern(1 0 1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) 
			keep(before_broad before broad corrupt_before fraction_broad median_before above_median_corrupt quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before ) 
			/*scalars("mayor_municipal Mayor and municipal controls" "state_fe State fixed effects")  */
			stats(N mD mayor_municipal state_fe r2_a b0_b2 p_value, fmt(%9.0fc %9.3fc ) labels("Observations" "Dep. Var. Mean" "Mayor and municipal controls" "State and term FE" "Adjusted R$^2$" "$\beta_0+\beta_2 \, c_{ist}$" "p-value"))
			/*nonum*/ ar2 booktabs nonotes nomtitles title(deletethis) 
			substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{table} %);
			#delimit cr
				
			
	
	
* table c16	 copartisan
		
preserve
	keep if merge_copartisan == 1		
	 sum camp_exp_pc if merge_copartisan == 1

eststo clear	

	* 0. Baseline: Average causal Impact of Information Disclosure.
		eststo reg_broad_basic: quietly areg camp_exp_pc before i.term , absorb(codigo_uf) robust cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_broad_basic

		* 0.1. baseline + controls
		eststo reg_broad_basic_c: quietly areg camp_exp_pc before $muni_controls $candidate_controls i.term , absorb(codigo_uf) robust cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_broad_basic_c
				estadd local mayor_municipal "\checkmark": reg_broad_basic_c

	* 1. Broad				
		eststo reg_broad: quietly areg camp_exp_pc before broad before_broad i.term , absorb(codigo_uf) robust cluster($cluster)
				* Add mean dependent variable
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_broad
				lincom before + before_broad
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_broad
				estadd local p_value `p_test': reg_broad

		*1.2. broad + controls			
		eststo reg_broad_c: quietly areg camp_exp_pc before broad before_broad  $muni_controls $candidate_controls i.term , absorb(codigo_uf) robust cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_broad_c
				estadd local mayor_municipal "\checkmark": reg_broad_c
				lincom before + before_broad
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_broad_c
				estadd local p_value `p_test': reg_broad_c				

	* 2. fraction_broad		
		eststo reg_fraction: quietly areg camp_exp_pc before fraction_broad corrupt_before i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_fraction
				sum fraction_broad if e(sample), mean 
				loc my_mean: display %9.3f r(mean)				
				lincom before + corrupt_before * `my_mean'	
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_fraction
				estadd local p_value `p_test': reg_fraction		
				
		*2.2 fraction_broad + controls			
		eststo reg_fraction_c: quietly areg camp_exp_pc before fraction_broad corrupt_before $muni_controls $candidate_controls  i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_fraction_c
				estadd local mayor_municipal "\checkmark": reg_fraction_c
				sum fraction_broad if e(sample), mean 
				loc my_mean: display %9.3f r(mean)				
				lincom before + corrupt_before * `my_mean'	
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_fraction_c
				estadd local p_value `p_test': reg_fraction_c
								
	* 3. above_median_broad 							
		eststo reg_median: quietly areg camp_exp_pc before above_median_corrupt median_before i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_median
				lincom before + median_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_median
				estadd local p_value `p_test': reg_median

		*3.2. above_median_broad + controls
		eststo reg_median_c: quietly areg camp_exp_pc before above_median_corrupt median_before $muni_controls $candidate_controls i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_median_c
				estadd local mayor_municipal "\checkmark": reg_median_c
				lincom before + median_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_median_c
				estadd local p_value `p_test': reg_median_c

	* 4. quartiles broad
		eststo reg_quart:   quietly areg camp_exp_pc before quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before i.term, absorb(codigo_uf) robust cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_quart
				lincom before + quart4_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_quart
				estadd local p_value `p_test': reg_quart

		*4.2 quartiles broad + controls
		eststo reg_quart_c: quietly areg camp_exp_pc before quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before $muni_controls $candidate_controls   i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_quart_c
				estadd local mayor_municipal "\checkmark": reg_quart_c
				lincom before + quart4_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_quart_c
				estadd local p_value `p_test': reg_quart_c
						
				
* EXPORT TABLE TO LATEX		
		#delimit;
			esttab reg_broad_basic reg_broad_basic_c reg_broad reg_broad_c reg_fraction reg_fraction_c reg_median reg_median_c reg_quart reg_quart_c
			using "tables and figures\table_c16.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace
			mgroups( "\shortstack{Information \\ disclosure}" "Corruption"   "Share corruption"  "\shortstack{Median \\ Corruption}"   "\shortstack{Quartiles\\ Corruption}"  , pattern(1 0 1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) 
			keep(before_broad before broad corrupt_before fraction_broad median_before above_median_corrupt quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before ) 
			stats(N mD mayor_municipal state_fe r2_a b0_b2 p_value, fmt(%9.0fc %9.3fc ) labels("Observations" "Dep. Var. Mean" "Mayor and municipal controls" "State and term FE" "Adjusted R$^2$" "$\beta_0+\beta_2 \, c_{ist}$" "p-value"))
			/*nonum*/ ar2 booktabs nonotes nomtitles title(deletethis) 
			substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{table} %);
			#delimit cr
				
restore
	
	
	
* tabla c.17

preserve
	keep if party == "PT" | party == "PSDB"
	 sum camp_exp_pc 


eststo clear	

	* 0. Baseline: Average causal Impact of Information Disclosure.
		eststo reg_broad_basic: quietly areg camp_exp_pc before i.term , absorb(codigo_uf) robust cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_broad_basic

		* 0.1. baseline + controls
		eststo reg_broad_basic_c: quietly areg camp_exp_pc before $muni_controls $candidate_controls i.term , absorb(codigo_uf) robust cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_broad_basic_c
				estadd local mayor_municipal "\checkmark": reg_broad_basic_c
	
	* 1. Broad				
		eststo reg_broad: quietly areg camp_exp_pc before broad before_broad i.term , absorb(codigo_uf) robust cluster($cluster)
				* Add mean dependent variable
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_broad
				lincom before + before_broad
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_broad
				estadd local p_value `p_test': reg_broad

		*1.2. broad + controls			
		eststo reg_broad_c: quietly areg camp_exp_pc before broad before_broad  $muni_controls $candidate_controls i.term , absorb(codigo_uf) robust cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_broad_c
				estadd local mayor_municipal "\checkmark": reg_broad_c
				lincom before + before_broad
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_broad_c
				estadd local p_value `p_test': reg_broad_c				

	* 2. fraction_broad		
		eststo reg_fraction: quietly areg camp_exp_pc before fraction_broad corrupt_before i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_fraction
				sum fraction_broad if e(sample), mean 
				loc my_mean: display %9.3f r(mean)				
				lincom before + corrupt_before * `my_mean'	
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_fraction
				estadd local p_value `p_test': reg_fraction		
				
		*2.2 fraction_broad + controls			
		eststo reg_fraction_c: quietly areg camp_exp_pc before fraction_broad corrupt_before $muni_controls $candidate_controls  i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_fraction_c
				estadd local mayor_municipal "\checkmark": reg_fraction_c
				sum fraction_broad if e(sample), mean 
				loc my_mean: display %9.3f r(mean)				
				lincom before + corrupt_before * `my_mean'	
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_fraction_c
				estadd local p_value `p_test': reg_fraction_c
								
	* 3. above_median_broad 							
		eststo reg_median: quietly areg camp_exp_pc before above_median_corrupt median_before i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_median
				lincom before + median_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_median
				estadd local p_value `p_test': reg_median

		*3.2. above_median_broad + controls	(Preferred specification)
		eststo reg_median_c: quietly areg camp_exp_pc before above_median_corrupt median_before $muni_controls $candidate_controls i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_median_c
				estadd local mayor_municipal "\checkmark": reg_median_c
				lincom before + median_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_median_c
				estadd local p_value `p_test': reg_median_c

	* 4. quartiles broad
		eststo reg_quart:   quietly areg camp_exp_pc before quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before i.term, absorb(codigo_uf) robust cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_quart
				lincom before + quart4_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_quart
				estadd local p_value `p_test': reg_quart

		*4.2 quartiles broad + controls
		eststo reg_quart_c: quietly areg camp_exp_pc before quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before $muni_controls $candidate_controls   i.term, absorb(codigo_uf) robust  cluster($cluster)
				sum camp_exp_pc if e(sample), mean 
				loc mymean: display %9.3f r(mean) 	
				estadd local mD `mymean', replace	
				estadd local state_fe "\checkmark": reg_quart_c
				estadd local mayor_municipal "\checkmark": reg_quart_c
				lincom before + quart4_before
				local estimate: display %9.3f r(estimate)
				local p_test: display %9.3f r(p)
				estadd local b0_b2 `estimate': reg_quart_c
				estadd local p_value `p_test': reg_quart_c
						
 

				
* EXPORT TABLE TO LATEX		
		#delimit;
			esttab reg_broad_basic reg_broad_basic_c reg_broad reg_broad_c reg_fraction reg_fraction_c reg_median reg_median_c reg_quart reg_quart_c
			using "tables and figures\table_c17.tex", b(3) se compress label star(* 0.10 ** 0.05 *** 0.01) replace
			mgroups( "\shortstack{Information \\ disclosure}" "Corruption"   "Share corruption"  "\shortstack{Median \\ Corruption}"   "\shortstack{Quartiles\\ Corruption}"  , pattern(1 0 1 0 1 0 1 0 1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) 
			keep(before_broad before broad corrupt_before fraction_broad median_before above_median_corrupt quartile2 quartile3 quartile4 quart2_before quart3_before quart4_before ) 
			/*scalars("mayor_municipal Mayor and municipal controls" "state_fe State fixed effects")  */
			stats(N mD mayor_municipal state_fe r2_a b0_b2 p_value, fmt(%9.0fc %9.3fc ) labels("Observations" "Dep. Var. Mean" "Mayor and municipal controls" "State and term FE" "Adjusted R$^2$" "$\beta_0+\beta_2 \, c_{ist}$" "p-value"))
			/*nonum*/ ar2 booktabs nonotes nomtitles title(deletethis) 
			substitute(\begin{table}[htbp]\centering \centering \caption{deletethis} /*\footnotesize*/{ \end{tabular} \end{tabular}} \end{table} %);
			#delimit cr
				
restore
eststo clear